<?php


namespace app\ymsh\controller;


use think\facade\Console;

class Test
{
    public function buildOrder()
    {

        if (isProd()) fail();

        $params = request()->all();
        $msg = dmjValidate([
            'agent_id' => 'require',
            'serv_type' => 'require',
            'user_id' => 'require',
        ], [], $params);

        if ($msg){
            return fail($msg);
        }



        $agent_id = $params['agent_id'];
        $serv_type = $params['serv_type'];
        $user_id = $params['user_id'];

        $agent = \app\model\Agent::query()->where('id',$agent_id)->find();

        if (!$agent){
            return  fail('搞什么！！！！id都错了,我怎么帮你');
        }

//        if ($agent->is_relation ==0){
//            return  fail('搞什么！！！！没有绑定的生成不了');
//        }
//
//        if (empty($agent->merchant_id)){
//            return  fail('搞什么！！！！没有绑定的生成不了');
//        }


        Console::call('buildorder',[$agent_id,$serv_type,$user_id]);

    }
}